//
//  PropertyExpensesListTableViewCell.swift
//  SmartHousekeeper
//
//  Created by 张磊 on 2020/2/21.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit

class PropertyExpensesListTableViewCell: UITableViewCell {
    
    lazy var monthL : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 40, g: 40, b: 40, a: 1), textFont: UIFont.systemFont(ofSize: Adapter(13)))
        value.text = "02月"
        value.textAlignment = .right
        return value
    }()
    lazy var yearL : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 167, g: 167, b: 167, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(11)))
        value.text = "2020年"
        value.textAlignment = .right
        return value
    }()
    lazy var moneyL : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 40, g: 40, b: 40, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(15)))
        value.text = "150.50"
        return value
    }()
    lazy var noL : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 167, g: 167, b: 167, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(11)))
        value.text = "202032232233232"
        return value
    }()
    lazy var lineTop : UIView = {
        let value = UIView()
        value.backgroundColor = RGBColor(r: 141, g: 141, b: 141, a: 1)
        return value
    }()
    lazy var lineBottom : UIView = {
        let value = UIView()
        value.backgroundColor = RGBColor(r: 141, g: 141, b: 141, a: 1)
        return value
    }()
    lazy var imgSelect : UIImageView = {
        let value = UIImageView(image: UIImage(named: "icon_success"))
        return value
    }()
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super .init(style: style, reuseIdentifier: reuseIdentifier)
        setCell()
    }
    private func setCell(){
        
        
        self.addSubview(imgSelect)
        imgSelect.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(Adapter(85))
            make.centerY.equalToSuperview()
            make.size.equalTo(CGSize(width: Adapter(25), height: Adapter(25)))
        }
        
        self.addSubview(monthL)
        monthL.snp.makeConstraints { (make) in
            make.bottom.equalTo(imgSelect.snp.centerY).offset(-Adapter(3))
            make.right.equalTo(imgSelect.snp.left).offset(-Adapter(8))
        }
        
        self.addSubview(yearL)
        yearL.snp.makeConstraints { (make) in
            make.top.equalTo(imgSelect.snp.centerY).offset(Adapter(3))
            make.right.equalTo(imgSelect.snp.left).offset(-Adapter(8))
        }
        
        self.addSubview(lineTop)
        lineTop.snp.makeConstraints { (make) in
            make.top.equalToSuperview();
            make.bottom.equalTo(imgSelect.snp.top);
            make.centerX.equalTo(imgSelect)
            make.width.equalTo(Adapter(0.8))
        }
        
        self.addSubview(lineBottom)
        lineBottom.snp.makeConstraints { (make) in
            make.top.equalTo(imgSelect.snp.bottom);
            make.bottom.equalToSuperview();
            make.centerX.equalTo(imgSelect)
            make.width.equalTo(Adapter(0.8))
        }
        
        self.addSubview(moneyL)
        moneyL.snp.makeConstraints { (make) in
            make.bottom.equalTo(imgSelect.snp.centerY).offset(-Adapter(3))
            make.left.equalTo(imgSelect.snp.right).offset(Adapter(8))
        }
        
        self.addSubview(noL)
        noL.snp.makeConstraints { (make) in
            make.top.equalTo(imgSelect.snp.centerY).offset(Adapter(3))
            make.left.equalTo(imgSelect.snp.right).offset(Adapter(8))
        }
    }
    
    
}
